﻿CREATE TABLE [dbo].[CheltuieliCentralizator] (
    [Data]          DATETIME        NOT NULL,
    [IDDepartament] INT             NOT NULL,
    [ArtAl]         VARCHAR (40)    NOT NULL,
    [CodUnitate]    SMALLINT        NOT NULL,
    [Suma]          DECIMAL (18, 2) DEFAULT ((0)) NOT NULL,
    [ArtAlParinte]  VARCHAR (40)    DEFAULT ('N/A') NOT NULL,
    CONSTRAINT [PK_CheltuieliCentralizator] PRIMARY KEY CLUSTERED ([Data] ASC, [IDDepartament] ASC, [ArtAl] ASC, [CodUnitate] ASC),
    CONSTRAINT [FK_CheltuieliCentralizator_ArticoleAliniate] FOREIGN KEY ([ArtAl], [CodUnitate]) REFERENCES [dbo].[ArticoleAliniate] ([ArtAl], [CodUnitate]),
    CONSTRAINT [FK_CheltuieliCentralizator_Departamente] FOREIGN KEY ([IDDepartament]) REFERENCES [dbo].[Departamente] ([IDDepartament]),
    CONSTRAINT [FK_CheltuieliCentralizator_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

